package pl.edu.pw.polygen.modeler.client.toolbox;

import pl.edu.pw.polygen.modeler.client.toolbox.buttons.HoleButton;
import pl.edu.pw.polygen.modeler.client.toolbox.buttons.MergeButton;
import pl.edu.pw.polygen.modeler.client.toolbox.buttons.SegmentButton;
import pl.edu.pw.polygen.modeler.client.toolbox.buttons.SelectButton;
import pl.edu.pw.polygen.modeler.client.toolbox.buttons.SplainButton;
import pl.edu.pw.polygen.modeler.client.toolbox.buttons.SubDomainButton;
import pl.edu.pw.polygen.modeler.client.toolbox.buttons.VertexButton;
import pl.edu.pw.polygen.modeler.client.workspace.IWorkspace;

import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.Paintable;
import com.vaadin.terminal.gwt.client.UIDL;

public class Toolbox extends Composite implements Paintable{
	private VerticalPanel panel;
	private Button selectButton;
	private Button vertexButton;
	private Button segmentButton;
	private Button splainButton;
	private Button mergeButton;
	private Button holeButton;
	private Button subDomainButton;
	
	public Toolbox(IWorkspace workspace){
		initToolbox(workspace);
		initWidget(panel);
	}
	
	private void initToolbox(IWorkspace workspace){
		createButtons(workspace);
		panel = new VerticalPanel();
		panel.setWidth("80px");
		
		panel.add(selectButton);
		panel.add(vertexButton);
		panel.add(segmentButton);
		panel.add(splainButton);
		panel.add(holeButton);
		panel.add(subDomainButton);
		panel.add(mergeButton);
	}
	
	private void createButtons(IWorkspace workspace){
		selectButton = new SelectButton(workspace);
		vertexButton = new VertexButton(workspace);
		segmentButton = new SegmentButton(workspace);
		splainButton = new SplainButton(workspace);
		mergeButton = new MergeButton(workspace);
		holeButton = new HoleButton(workspace);
		subDomainButton = new SubDomainButton(workspace);
	}

	@Override
	public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
		// TODO Auto-generated method stub
		
	}
	
	
}
